package com.brainardphotography.blog.web;

import com.brainardphotography.blog.BlogEntry;
import com.brainardphotography.blog.dao.BlogEntryDAO;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.google.sitebricks.At;
import com.google.sitebricks.Show;
import com.google.sitebricks.http.Get;

@At("/entry/:id")
@Show("Home.html")
public class Entry extends BasePage {
	private static final long serialVersionUID = 8792601259417050659L;

	private BlogEntry blogEntry;
	
	@Inject
	private BlogEntryDAO entryDAO;
	
	public BlogEntry getBlogEntry() {
		return blogEntry;
	}
	
	public void setEntry(BlogEntry entry) {
		this.blogEntry = entry;
	}
	
	@Get
	public void get(@Named("id") String id) {
		blogEntry = entryDAO.get(id);
	}
}
